%% mtool.m
clear all;
clc;
close all;
%%
img=imread('hz.jpg');
imshow(img);
hold on;
X=[];
Y=[];
for i=1:20
   [x,y]=ginput(1);
   plot(x,y,'r.');
   X(i)=x;
   Y(i)=y;
end
tri=delaunay(X,Y)
trinum=size(tri,1);
for i=1:trinum
    plot([X(tri(i,1));X(tri(i,2))],[Y(tri(i,1)),Y(tri(i,2))],'g')
    plot([X(tri(i,3));X(tri(i,2))],[Y(tri(i,3)),Y(tri(i,2))],'g')
    plot([X(tri(i,1));X(tri(i,3))],[Y(tri(i,1)),Y(tri(i,3))],'g')    
end
%hold off;

